<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>

 
<html>
<head>
<title>SELECT Operation</title>
</head>
<body>
 
<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
     url="jdbc:mysql://127.0.0.1:3306/db1"
     user="root"  password="123456"/>
 
<sql:query dataSource="${snapshot}" var="result">
SELECT * from users;
</sql:query>
 
<table border="1" width="100%">
<tr>
   <th>name</th>
   <th>gender</th>
</tr>
<c:forEach var="row" items="${result.rows}">
<tr>
   <td><c:out value="${row.name}"/></td>
   <td><c:out value="${row.gender}"/></td>
</tr>
</c:forEach>
</table>

<jsp:useBean id="web" 
                    class="com.web.SQLConnection"> 
   
</jsp:useBean>

<p>Student First Name: 
   <jsp:getProperty name="web" property="data"/>
</p>
 
</body>
</html>